import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author Kewen-Du
 * @date 2022/10/13
 */
public class Test {
    public static void main(String[] args) {
        try {
            ExecutorService executorService = Executors.newFixedThreadPool(4);
            Cache<Integer, Integer> lruCache = new LRUCache<>(4);
            for (int i = 0; i < 20; i++) {
                Random random = new Random();
                int num = random.nextInt(10);
                executorService.execute(() -> {
                    lruCache.put(num, num);
                });
            }
            executorService.shutdown();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
